package nl.hanze.designpatterns.Domain;

import java.io.Serializable;

public class LoginCredential implements Serializable{
    public Integer id;
    public String username;
    public String password;
	
	public LoginCredential() {}
	
	public LoginCredential(String userName, String password) {
		this.setUserName(userName);
		this.setPassword(password);
	}
	
	public String getUserName() {
		return username;
	}

	public void setUserName(String userName) {
		this.username = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	@Override
	public String toString() {
		return username+"::"+password;
	}

    @Override
    public boolean equals(Object other) {
        if ( this == other ) return true;
        if ( !(other instanceof LoginCredential) ) return false;

        LoginCredential that = (LoginCredential)other;
        return that.getUserName().equals(this.getUserName()) && that.getPassword().equals(this.getPassword());
    }
}
